<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Reference</title>
    <link rel="stylesheet" href="ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>MineTest.Me Auth Mod</h1>


<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions </a></li>
</ul>


<h2>Modules</h2>
<ul class="nowrap">
  <li><strong>init</strong></li>
</ul>

</div>

<div id="content">

<h1>Module <code>init</code></h1>
<p>auth class table</p>
<p></p>


<h2><a href="#Functions">Functions </a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#auth.get_default_privs">auth.get_default_privs ()</a></td>
	<td class="summary">Get default privs from minetest.conf and convert to table</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.is_admin">auth.is_admin (string)</a></td>
	<td class="summary">Check to see if a player is the admin</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.exists">auth.exists (string)</a></td>
	<td class="summary">Check to see if a player has an auth entry</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.get">auth.get (string)</a></td>
	<td class="summary">Get entry from cache or database
 Get auth entry from the cache if caching is enabled.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.set">auth.set (string, table)</a></td>
	<td class="summary">Set entry data and cache
 Creat or update an auth entry.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.name_ok">auth.name_ok (string)</a></td>
	<td class="summary">Check to see if a player name is okay</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.password_ok">auth.password_ok (string)</a></td>
	<td class="summary">Check to see if a password string is okay</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.get_auth">auth.get_auth (string)</a></td>
	<td class="summary">Get auth information for a player from the cache or database
 If entry exists in cache it will be returned and if it does
 not(rare) then the entry will be cached as well as returned.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.create_auth">auth.create_auth (string, string, string)</a></td>
	<td class="summary">Create new entry for user in the auth table</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.delete_auth">auth.delete_auth (string)</a></td>
	<td class="summary">Create new entry for user in the auth table</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.set_password">auth.set_password (string, string)</a></td>
	<td class="summary">Set player password</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.set_privileges">auth.set_privileges (string, table)</a></td>
	<td class="summary">Set player privileges</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.reload">auth.reload ()</a></td>
	<td class="summary">Here only for compatibility</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.record_login">auth.record_login (string)</a></td>
	<td class="summary">Update player's last login timestamp</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.import_legacy">auth.import_legacy ()</a></td>
	<td class="summary">Import legacy auth.txt file and rename to auth.txt.import</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.save_legacy_record">auth.save_legacy_record (string)</a></td>
	<td class="summary">Save a single record from the legacy auth.txt file</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.gc">auth.gc (float)</a></td>
	<td class="summary">Garbage collection.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#auth.init">auth.init (_G)</a></td>
	<td class="summary">Initialize the auth mod</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions </h2>

    <dl class="function">
    <dt>
    <a name = "auth.get_default_privs"></a>
    <strong>auth.get_default_privs ()</strong>
    </dt>
    <dd>
    Get default privs from minetest.conf and convert to table



    <h3>Returns:</h3>
    <ol>

        table
    </ol>




</dd>
    <dt>
    <a name = "auth.is_admin"></a>
    <strong>auth.is_admin (string)</strong>
    </dt>
    <dd>
    Check to see if a player is the admin


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name of player
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.exists"></a>
    <strong>auth.exists (string)</strong>
    </dt>
    <dd>
    Check to see if a player has an auth entry


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name of player
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.get"></a>
    <strong>auth.get (string)</strong>
    </dt>
    <dd>
    Get entry from cache or database
 Get auth entry from the cache if caching is enabled.  If entry not in the
 cache then it will be selectd from the database and cached.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name of player
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        table
    </ol>




</dd>
    <dt>
    <a name = "auth.set"></a>
    <strong>auth.set (string, table)</strong>
    </dt>
    <dd>
    Set entry data and cache
 Creat or update an auth entry.  The data table supplied can be all auth fields
 or a subset. IF caching is enabled the the entry will be cached after a
 successful update of the database table.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name of player
        </li>
        <li><span class="parameter">table</span>
          auth entry data
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.name_ok"></a>
    <strong>auth.name_ok (string)</strong>
    </dt>
    <dd>
    Check to see if a player name is okay


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name of player
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.password_ok"></a>
    <strong>auth.password_ok (string)</strong>
    </dt>
    <dd>
    Check to see if a password string is okay


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         password
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.get_auth"></a>
    <strong>auth.get_auth (string)</strong>
    </dt>
    <dd>
    Get auth information for a player from the cache or database
 If entry exists in cache it will be returned and if it does
 not(rare) then the entry will be cached as well as returned.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        table
    </ol>




</dd>
    <dt>
    <a name = "auth.create_auth"></a>
    <strong>auth.create_auth (string, string, string)</strong>
    </dt>
    <dd>
    Create new entry for user in the auth table


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         reason
        </li>
        <li><span class="parameter">string</span>
         reason
        </li>
        <li><span class="parameter">string</span>
         reason
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.delete_auth"></a>
    <strong>auth.delete_auth (string)</strong>
    </dt>
    <dd>
    Create new entry for user in the auth table


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name
        </li>
    </ul>





</dd>
    <dt>
    <a name = "auth.set_password"></a>
    <strong>auth.set_password (string, string)</strong>
    </dt>
    <dd>
    Set player password


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         password
        </li>
        <li><span class="parameter">string</span>
         password
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.set_privileges"></a>
    <strong>auth.set_privileges (string, table)</strong>
    </dt>
    <dd>
    Set player privileges


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name
        </li>
        <li><span class="parameter">table</span>
          privileges
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.reload"></a>
    <strong>auth.reload ()</strong>
    </dt>
    <dd>
    Here only for compatibility



    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.record_login"></a>
    <strong>auth.record_login (string)</strong>
    </dt>
    <dd>
    Update player's last login timestamp


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         name
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        boolean
    </ol>




</dd>
    <dt>
    <a name = "auth.import_legacy"></a>
    <strong>auth.import_legacy ()</strong>
    </dt>
    <dd>
    Import legacy auth.txt file and rename to auth.txt.import







</dd>
    <dt>
    <a name = "auth.save_legacy_record"></a>
    <strong>auth.save_legacy_record (string)</strong>
    </dt>
    <dd>
    Save a single record from the legacy auth.txt file


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">string</span>
         line
        </li>
    </ul>





</dd>
    <dt>
    <a name = "auth.gc"></a>
    <strong>auth.gc (float)</strong>
    </dt>
    <dd>
    Garbage collection.  Remove cached auth entries for users no longer logged in.
 This should run at least once per hour of uptime. If the player is not logged in
 at that time their cache entry will be removed.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">float</span>
         dtime
        </li>
    </ul>





</dd>
    <dt>
    <a name = "auth.init"></a>
    <strong>auth.init (_G)</strong>
    </dt>
    <dd>
    Initialize the auth mod


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">_G</span>
         global scope
        </li>
    </ul>





</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-04-18 19:44:01 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
